import LidarComponent, { UseComponent } from "@components/Apps/Lidar/LidarComponent";
import { ClientMessage } from "@runtime/generate/message/ClientMessage";
import DeviceComponent from "@runtime/module/Device/DeviceComponent";
import MessageHandler from "@runtime/module/Handler/MessageHandler";

/**
 * 设备更新消息处理器
 */
export default class DeviceUpdateMessageHandler extends MessageHandler<ClientMessage.DeviceUpdateMessage> {            
    protected async RunAsync(message: ClientMessage.DeviceUpdateMessage): Promise<void> {
        console.log('11111111111111111111111111111111111111');
        DeviceComponent.Default.Update(message.Informations);
        console.log('设备连接消息',message.Informations[0]);
        // UseComponent.Default.deviceState.value = message.Informations[0].Status
        LidarComponent.Default.connect.value = message.Informations[0].Status
    }
}
